package net.sf.rose.redis;

import net.sf.rose.jdbc.bean.annotation.Column;
import net.sf.rose.jdbc.bean.annotation.Table;
import net.sf.rose.jdbc.bean.annotation.Type;

/**
 * @Description: redis缓存配置信息表
 * @author fengjian
 * @date 2018年7月101日
 * @tags
 */
@Table(name = "AD_REDIS_CONFIG",description = "redis缓存配置信息表")
public class RedisPoolBean {

	@Column(pk = true, type = Type.定长文本, description = "主键编号", canNull = false, size = 32, policy = "UUID")
	private String redisPoolID;

	@Column(type = Type.变长文本, description = "工程名称", size = 50, canNull = false)
	private String projectName;

	@Column(type = Type.变长文本, description = "redis服务器ip", size = 50, canNull = false)
	private String ip = null;

	@Column(type = Type.数字整型, description = "redis服务器端口号")
	private int port = 6379;

	@Column(type = Type.变长文本, description = "访问密码", size = 50)
	private String password = null;

	@Column(type = Type.数字整型, description = "与服务器建立连接的超时时间")
	private int timeout = 3000;

	@Column(type = Type.数字整型, description = "最大活跃连接数")
	private int maxActive = 100;

	@Column(type = Type.数字整型, description = "最大空闲连接数")
	private int maxIdle = 50;

	// jedis池没有连接对象返回时，等待可用连接的最大时间，单位毫秒，默认值为-1，表示永不超时。
	// 如果超过等待时间，则直接抛出JedisConnectionException
	@Column(type = Type.数字长整型, description = "最长等待时间")
	private long maxWait = 1500;

	// 从池中获取连接的时候，是否进行有效检查,true:false
	@Column(type = Type.数字整型, description = "是否进行有效检查")
	private int testOnBorrow = 1;

	// 归还连接的时候，是否进行有效检查,true:false
	@Column(type = Type.数字整型, description = "是否进行有效检查")
	private int testOnReturn = 1;

	public String getRedisPoolID() {
		return redisPoolID;
	}

	public void setRedisPoolID(String redisPoolID) {
		this.redisPoolID = redisPoolID;
	}

	public String getProjectName() {
		return projectName;
	}

	public void setProjectName(String projectName) {
		this.projectName = projectName;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public int getPort() {
		return port;
	}

	public void setPort(int port) {
		this.port = port;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public int getTimeout() {
		return timeout;
	}

	public void setTimeout(int timeout) {
		this.timeout = timeout;
	}

	public int getMaxActive() {
		return maxActive;
	}

	public void setMaxActive(int maxActive) {
		this.maxActive = maxActive;
	}

	public int getMaxIdle() {
		return maxIdle;
	}

	public void setMaxIdle(int maxIdle) {
		this.maxIdle = maxIdle;
	}

	public long getMaxWait() {
		return maxWait;
	}

	public void setMaxWait(long maxWait) {
		this.maxWait = maxWait;
	}

	public int getTestOnBorrow() {
		return testOnBorrow;
	}

	public void setTestOnBorrow(int testOnBorrow) {
		this.testOnBorrow = testOnBorrow;
	}

	public int getTestOnReturn() {
		return testOnReturn;
	}

	public void setTestOnReturn(int testOnReturn) {
		this.testOnReturn = testOnReturn;
	}

}
